import React from "react";
import { allRegisterInfo } from "../../regist-components";
import { WidgetInfo } from "../../types";
import "./index.less";

type Props = {
  info: WidgetInfo;
};

interface RegistrerWidgetProps extends WidgetInfo {}

export default function CardContent(props: Props) {
  const { info } = props;

  return (
    <div className='bi-card-content'>
      {React.createElement(allRegisterInfo[info.name].components, {
        key: info.id,
        ...info
      })}
    </div>
  );
}

export type { RegistrerWidgetProps };
